<!DOCTYPE html>
<!-- saved from url=(0085)https://ent.safe517.com/fdWebCompany/findView/replenish.supplier.supplier?newSearch=1 -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">








<title>万达食品安全追溯系统</title>
<script src="./jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="./custome.js" type="text/javascript" charset="utf-8"></script>	
<script src="./jquery.form.js" type="text/javascript"></script>
<script src="./popup.js" type="text/javascript"></script>
<script src="./common(1).js" type="text/javascript">_csrf&b02b984c-40c2-4d40-bb4c-e2c946d9878a</script>	
<script src="./common1.js" type="text/javascript" charset="utf-8"></script>
<script src="./plupload.full.min.js" type="text/javascript"></script>	
<script src="./reAlert.js" type="text/javascript"></script>	
<link href="./common.css" rel="stylesheet" type="text/css">
<link href="./style.css" rel="stylesheet" type="text/css">
<!-- 图片查看 -->
<script src="./jquery-rotate-2.3.min.js" type="text/javascript"></script>
<script src="./jquery.ui.js" type="text/javascript"></script>
<link href="./foximg.css" rel="stylesheet" type="text/css">
<script src="./foximg.js" type="text/javascript" charset="utf-8"></script>
<!-- <script src="../js/bigimg.js" type="text/javascript" charset="utf-8"></script> -->

<script type="text/javascript">
	var fileServer = "https://image.safe517.com/fdWebFile";
	var imgFilePath="https://image.safe517.com/fdWebFile";
	var circulationType="CATERING";
	var circulationParam={empFile:"从业人员_V20170815.xlsx", outputBatchFile:"发货台账导入_V20170511.xlsx",inputBatchFile:"进货台账导入_V20170511.xlsx",inputMat:"采购品", inputMatFile:"采购品导入_V20170815.xlsx",outputMat:"产出品", outputMatFile:"产出品导入_V20151130.xlsx", menu:"10001,",adminMenu:"10001,10017,11701,11702,11703,"};
	var circulationJobs={jobs:"企业负责人,厨师长,门店经理,大堂经理,原材料检验人员,食品安全负责人,采购负责人,分餐人员,专间操作人员,餐饮具消毒人员,餐饮主管人员,厨师,仓库负责人,仓管人员,其他"};
	/* $('input').bind('input propertychange', function() {
		alert("111");
		$(this).val($(this).val().replace(/([';])+|(--)+/g,"").replace(/<[^>]+>/g,""));
	}); */
	
    //gloabal ajax
    $(document).ajaxComplete(function( event,request, settings ) {
    	if( request.status === 302  || request.status===403){
    		window.location = "..";
    	}
    });
	  //点击查看大图
   $(function(){
	   $('div[rel="img"]').foximg(); 
   })  
	var oldajax = $.ajax;
	$.ajax = function(options){
		if(!(options.headers)){
			options.headers={};
		}
		options.headers['X-CSRF-TOKEN'] = 'b02b984c-40c2-4d40-bb4c-e2c946d9878a';
		return oldajax(options);
	};

	
	
	
	
</script>
</head><body><div id="loading" style="position: absolute; top: 50%; left: 50%; margin: 0px auto; height: 300px; z-index: 888; display: none;"><img src="./loading.gif"></div>
   
<script src="./jquery.qrcode.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var pageSize=20;
var pageNum=parseInt("1");
var totalPage;
var params = {"newSearch":"1"};
var queryName="";
var com_id='160499';
function search(pageNum){
	$(".paging_head").removeClass("disabled");
	$(".paging_head input").attr("disabled",false);
	$(".paging_perv").removeClass("disabled");
	$(".paging_perv input").attr("disabled",false);
	$(".paging_next").removeClass("disabled");
	$(".paging_next input").attr("disabled",false);
	$(".paging_trailer").removeClass("disabled");
	$(".paging_trailer input").attr("disabled",false);
	$("#loading").show();
	$.ajax({
		url:"../inputManage/supplier/querySuppliers/"+pageNum+"/"+pageSize,
		type:"post",
		data:JSON.stringify(params),
		dataType:"json",
		headers: { 
	        'Accept': 'application/json',
	        'Content-Type': 'application/json' 
	    },
		success:function(result){
			if(result.status==0){
				console.log(result.body);
				page(result);
				//$("#can").hide();
				//$(".table_box").show();
				$("tbody").children().remove();
				var	totalNum=result.body.totalRecord;
				var suppliers=result.body.resultList;
				for(var i=0;i<suppliers.length;i++){
					var id=suppliers[i].id;
					var name=isNullForTable(suppliers[i].name);
					var contactAddress=isNullForTable(suppliers[i].contactAddress);
					var contactPerson=isNullForTable(suppliers[i].contactPerson);
					var contactPhone=isNullForTable(suppliers[i].contactPhone);
					var nameAbbrev=isNullForTable(suppliers[i].nameAbbrev);
					var code=isNullForTable(suppliers[i].code);
					var linkedCompanyId=isnull(suppliers[i].linkedCompanyId);
					var contractFlag=isnull(suppliers[i].contractFlag);
					var flag=""
					if(linkedCompanyId!=""){
						flag='<i class="i_has"></i>';
					}else{
						flag='<i class="i_not"></i>';
					}
					if(contractFlag!=""){
						flag='<i class="i_argee"></i>';
					}
					var row=(pageNum-1)*pageSize+i+1;
					var $tr=$('<tr><td class="td_ser">'+flag+'</td><td class="td_ser">'+row+'</td><td>'+name+'</td><td>'+nameAbbrev+'</td><td>'+code+'</td><td>'+contactPerson+'</td><td>'+contactPhone+'</td><td class="td_opera"><a href="replenish.supplier.supplier-view?id='+id+'" class="btn_green">查看</a><a href="replenish.supplier.supplier-editor2?id='+id+'" class="btn_green">编辑</a><a href="javascript:void(0)" class="btn_green" rel="popup" link="replenish.supplier.iframe-del?id='+id+'&queryName='+encodeURI(encodeURI(queryName))+'&totalNum='+totalNum+'&pageNum='+pageNum+'" title="提示">删除</a></td><td><a href="javascript:void(0)" class="btn_qrcode" rel="popup_qrcode" link="'+com_id+'_'+name+'_'+id+'_SUPPLIER" title="查看二维码" id="qrcode_i1"><img src="../images/qrcode_small.jpg" /></td></tr>');
					if(i%2==0){
						$tr.addClass("even");
					}
					$("tbody").append($tr);
				}
				$("#totalPage em").text(totalPage);
				$("#paging_num").val(pageNum);
				if(pageNum==1){
					$(".paging_head").addClass("disabled");
					$(".paging_head input").attr("disabled",true);
					$(".paging_perv").addClass("disabled");
					$(".paging_perv input").attr("disabled",true);
				}
				if(pageNum==totalPage){
					$(".paging_next").addClass("disabled");
					$(".paging_next input").attr("disabled",true);
					$(".paging_trailer").addClass("disabled");
					$(".paging_trailer input").attr("disabled",true);
				}
			}
			$("#loading").hide();
		},
		error:function(e){
			console.log(e);
		}
	});
}

function huifu(){
	$(".btn_export").removeAttr("disabled");
}

$(function(){
	$(".query_input").val(queryName);
	//$(".table_box").hide();
	//$("#can").load("../findView/replenish.supplier.init");
	search(pageNum);
	//点击上一页查询
	$(".paging_perv").click(function(){
		if(pageNum==1){
			params.newSearch="1";
			search(pageNum);
		}else{
			$(".paging_box a").removeClass("default");
			pageNum +=-1;
			$("#page"+pageNum).addClass("default");
			params.newSearch="1";
			search(pageNum);
		}
	});
	//点击下一页查询
	$(".paging_next").click(function(){
		if(pageNum==totalPage){
			params.newSearch="1";
			search(pageNum);
		}else{
			$(".paging_box a").removeClass("default");
			pageNum +=1;
			$("#page"+pageNum).addClass("default");
			params.newSearch="1";
			search(pageNum);
		}
	});
	//点击首页查询数据
	$(".paging_head").click(function(){
		pageNum=1;
		params.newSearch="1";
		search(pageNum);
	});
	//点击尾页查询数据
	$(".paging_trailer").click(function(){
		pageNum=totalPage;
		params.newSearch="1";
		search(pageNum);
	});
	//点击确定查询数据
	$("#page_btn").click(function(){
		var pageNo=$("#paging_num").val().trim();
		if(isNaN(pageNo)||pageNo==null||pageNo==""){
			return;
		}else{
			pageNum=parseInt($("#paging_num").val().trim());
			if(pageNum<1){
				pageNum=1;
				params.newSearch="1";
				search(pageNum);
			}else  if(pageNum>totalPage){
				pageNum=totalPage;
				params.newSearch="1";
				search(pageNum);
			}else{
				params.newSearch="1";
				search(pageNum);
			}
		}
	});
	//点击查询按钮查询数据
	$(".btn_query").click(function(){
		queryName=$(".query_input").val().trim();
		params.name=queryName;
		pageNum=1;
		params.newSearch="1";
		search(pageNum);
	});
	//回车事件
	document.onkeydown= function(e){
		e = e ? e : event; 
		if(e.keyCode == 13){
			$(".btn_query").click();
	 	} 
	}
	

	$(".btn_export").click(function(){
		$(".btn_export").attr("disabled","true");
		queryNameForExport=$(".query_input").val().trim();
	/* 	receiverName =$("#receiverName").val().trim();
		outputDate =$("#date_para").val().trim(); */
		
		var exportParam={};
		
		exportParam.name=queryNameForExport;
	/* 	exportParam.receiverName=receiverName;
		exportParam.materialName=materialName; */
		
		$.ajax({
			url: "../inputManage/supplier/querySuppliers",
			type:"post",
		    headers: { 
		        'Accept': 'application/json',
		        'Content-Type': 'application/json' 
		    },
		    dataType:'json',
			data:JSON.stringify(exportParam),
			success:function(result){
				window.location.href=imgFilePath+result.body;
				 setTimeout('huifu()',10000);
			},
			error:function(){
				alert("结果异常，导出失败！");
				 setTimeout('huifu()',10000);
			}
		});
	});
	
});
</script>


<div class="main_box">
    <div class="main_con">
          <h3 class="process_title"><span>当前位置: </span><a href="https://ent.safe517.com/fdWebCompany/findView/replenish.supplier.supplier?newSearch=1#">供应商管理</a> 
              <div class="btn_opera" style="width:520px;"> 
              <!-- <a href="#" class="btn_export" style="width:180px;margin-left:20px">按照查询条件导出供应商</a>  --> 
                   <input type="button" class="btn_editor" value="维护协议单位" onclick="window.location.href=&#39;replenish.supplier.supplier-unit&#39;">
                   <input type="button" class="btn_add" value="添加供应商" onclick="window.location.href=&#39;replenish.supplier.supplier-add2&#39;">
              		<input type="button" class="btn_add btn_export" value="导出查询结果"> 
              </div>
          </h3>
          <div class="query">
               <span><em>供应商名称：</em><input type="text" class="query_input" value=""></span>
               <input type="button" class="btn_query" value="查询">
          </div>
          <div class="table_box">
               <table class="table_list">
                    <thead>
                       <tr>
                       	   <th></th>
                           <th style="min-width:30px">序号</th>
                           <th style="min-width:250px">供应商名称</th>
                           <th style="min-width:100px">供应商简称</th>
                           <th style="min-width:100px">供应商编号</th>
                           <th style="min-width:100px">联系人姓名</th>
                           <th style="min-width:100px">联系电话</th>
                           <!-- <th>固定电话</th>
                           <th>邮箱</th> -->
                           <th style="min-width:100px">操作</th>
                           <th style="min-width:60px">二维码</th>
                       </tr>
                    </thead>
                    <tbody>
                    <tr class="even"><td class="td_ser"><i class="i_not"></i></td><td class="td_ser">1</td><td>供应商</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td class="td_opera"><a href="https://ent.safe517.com/fdWebCompany/findView/replenish.supplier.supplier-view?id=706343" class="btn_green">查看</a><a href="https://ent.safe517.com/fdWebCompany/findView/replenish.supplier.supplier-editor2?id=706343" class="btn_green">编辑</a><a href="javascript:void(0)" class="btn_green" rel="popup" link="replenish.supplier.iframe-del?id=706343&amp;queryName=&amp;totalNum=1&amp;pageNum=1" title="提示">删除</a></td><td><a href="javascript:void(0)" class="btn_qrcode" rel="popup_qrcode" link="160499_供应商_706343_SUPPLIER" title="查看二维码" id="qrcode_i1"><img src="./qrcode_small.jpg"></a></td></tr></tbody>
                 </table>
                 <div class="regunit">
                      <span><i class="i_has"></i><em>已关联注册单位</em></span>
                      <span><i class="i_not"></i><em>未关联注册单位</em></span>
                      <span><i class="i_argee"></i><em>协议单位</em></span>
                 </div>
                 <p class="paging_box">
                   <span class="paging_head disabled"><input type="button" value="首页" style="padding:3px 5px" disabled="disabled"></span>
                   <span class="paging_perv disabled"><input type="button" value="&lt;&lt; 上一页" disabled="disabled"></span><a href="https://ent.safe517.com/fdWebCompany/findView/replenish.supplier.supplier?newSearch=1#" id="page1" class="default">1</a>
                   <span class="paging_next disabled"><input type="button" value="下一页 &gt;&gt;" disabled="disabled"></span>
                   <span class="paging_trailer disabled"><input type="button" value="尾页" style="padding:3px 5px" disabled="disabled"></span>
                   <span class="num_text" id="totalPage">共<em>1</em>页</span><span class="num_text page_record">共<em>1</em>条记录</span>  
                   <span class="num_text">跳转 <input type="text" id="paging_num" value="" style="width:20px;height: 20px;" onkeyup="javascript:this.value=this.value.replace(/\D/g,&#39;&#39;)" maxlength="6"></span>
                   <!-- <input id="page_btn" type="button" value="确定" class="btn_query" style="float:none;float: none;width: 40px;font-size: 12px;height: 28px;line-height: 28px;"> -->
                   <input type="button" class="paging_btn" value="确 定" id="page_btn">
                 </p>
                 <div class="clear"></div>
          </div>
     </div>
</div>

</body></html>